import { mgop } from "@aligov/jssdk-mgop";

export default function(url, params) {
  return new Promise((resolve, reject) => {
    mgop({
      api: url, // 必须
      data: params,
      host: "https://mapi.zjzwfw.gov.cn/",
      dataType: "JSON",
      type: "POST",
      appKey: "38j0tfmd+2001886320+fxsuxx", // 必须
      onSuccess: (data) => {
        console.log("data", data);
        resolve(data);
      },
      onFail: (err) => {
        console.log(err, "err");
      },
    });
  });
}

